package com.qing.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qing.picture.model.dto.user.UserLoginRequest;
import com.qing.picture.model.dto.user.UserQueryRequest;
import com.qing.picture.model.entity.User;
import com.qing.picture.model.vo.LoginUserVo;
import com.qing.picture.model.dto.user.UserRegisterRequest;
import com.qing.picture.model.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 86157
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-03-14 16:17:11
*/
public interface UserService extends IService<User> {

    /**
     * 用户登录
     *
     * @param userLoginRequest
     * @param request
     * @return 脱敏后的用户信息
     */
    LoginUserVo userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);
    /**
     * 获取当前登录用户
     *
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    LoginUserVo getLoginUserVO(User user);
    User userRegister(UserRegisterRequest request);
    /**
     * 获取加密后的密码
     *
     * @param userPassword
     * @return
     */
    String getEncryptPassword(String userPassword);
    /**
     * 获取查询条件
     *
     * @param userQueryRequest
     * @return
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);
    List<UserVo> getUserVOList(List<User> userList);

    boolean isAdmin(User user);
    UserVo getUserVO(User user);
}
